//
//  HotBrandCollectionCell.m
//  19_汽车之家
//
//  Created by dllo on 16/8/9.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HotBrandCollectionCell.h"
#import "UIImageView+WebCache.h"
#import "HotBrand.h"

@interface HotBrandCollectionCell ()
@property (nonatomic, strong) UIImageView *imgView;
@property (nonatomic, strong) UILabel *nameLabel;
@end

@implementation HotBrandCollectionCell

- (void)setHotBrand:(HotBrand *)hotBrand {
    _hotBrand = hotBrand;
    [_imgView sd_setImageWithURL:[NSURL URLWithString:_hotBrand.img]];
    _nameLabel.text = _hotBrand.name;
}

- (instancetype) initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        _imgView = [[UIImageView alloc] init];
        [self.contentView addSubview:_imgView];
        _nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_nameLabel];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _imgView.frame = CGRectMake(4, 8, 62, 53);
    _nameLabel.frame = CGRectMake(4, 64, 62, 23);
    _nameLabel.textAlignment = NSTextAlignmentCenter;
}

@end
